package com.jiawei.util;

import com.jiawei.entity.database.User;
import sun.misc.BASE64Encoder;

import java.security.MessageDigest;

/**
 * @author : willian fu
 * @date : 2019/12/11
 */
public class Md5Util {

    public static String Md5Decode(String str){
        MessageDigest md5= null;
        try {
            md5 = MessageDigest.getInstance("MD5");
            BASE64Encoder base64en = new BASE64Encoder();
            return base64en.encode(md5.digest(str.getBytes("utf-8")));
        } catch (Exception e) {
            e.printStackTrace();
            return "";
        }
    }
}
